import LoginView from '@/views/LoginView.vue'
import Homeindex from '@/views/home/Homeindex.vue'
// import UsersView from '@/views/user/UsersView.vue'
import RolesView from '@/views/authoritymanage/RolesView.vue'
import RightsView from '@/views/authoritymanage/RightsView.vue'
import GoodsList from '@/views/goodsControl/GoodsList.vue'

const routes = [
  { path: '/', component: LoginView },
  {
    path: '/home',
    name: 'home',
    // 转发,改变请求的地址
    // redirect: '/home/welcome',
    component: Homeindex,
    children: [
      // { path: 'users', name: 'users', component: UsersView },
      // 懒加载
      { path: 'users', name: 'users', component: () => import('@/views/user/UsersView.vue') },
      { path: 'roles', name: 'roles', component: RolesView },
      { path: 'rights', name: 'rights', component: RightsView },
      { path: 'goods', name: 'goods', component: GoodsList },
      { path: 'Params', name: 'Params', component: () => import('@/views/goodsControl/GoodParams.vue') },
      { path: 'Categories', name: 'Categories', component: () => import('@/views/goodsControl/GoodCategories.vue') },
      { path: 'reports', name: 'reports', component: () => import('@/views/reports/ReportsView.vue') },
      { path: 'orders', name: 'orders', component: () => import('@/views/orderManage/ordersView.vue') },
      { path: 'home/goods/add', name: 'GoodAdd', component: () => import('@/views/goodsControl/GoodAdd.vue') },
    ],
  },
]
export default routes
